﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MISAPP.Classify.DataAccess;
using System.Data;

namespace MISAPP.Classify.Service
{
    public class Service_CIB_DD_TD
    {
        public string[] Sheets = { "外定利差", "外活利差", "外幣活"
                                     , "外幣定", "外活佔比", "外定佔比" 
                                 ,"外活FTP利差","外定FTP利差"};

        protected DA_CIB_DD_TD da = null;

        protected DA_CIB_DD_TD DA
        { 
            get
            {
                if (da == null)
                {
                    da = new DA_CIB_DD_TD();
                }
                return da;
            }            
        }

        protected int ymCount = 0;

        public DataSet GetSummaryData(string p_year)
        {
            return DA.GetSummary(p_year,"","");
        }

        public DataSet GetSummaryData(string[] p_yms)
        {
            DataSet ds =DA.GetSummary(p_yms, "", "");
            ymCount = DA.GetYMCount();
            return ds;
        }


        public DataSet GetWMGSummaryData(string p_year)
        {
            return DA.GetWMGSummary(p_year, "", "");
        }

        public DataSet GetWMGSummaryData(string[] p_year)
        {
            return DA.GetWMGSummary(p_year, "", "");
        }



        /// <summary>
        /// 先在DA 那計算出共有多少個月，再取回來
        /// </summary>
        /// <returns></returns>
        public int GetYMColumnCount()
        { return ymCount; }


        public string[] GetCriteriaArray()
        {
            return DA.GetDistinctField();
        }

        public DataSet GetCriteriaData()
        {
            return DA.GetCriteria();
        }

        /// <summary>
        /// 外幣活的SheetName
        /// </summary>
        /// <returns></returns>
        public string GetDDSheetName()
        {
            return Sheets[2];
        }

        /// <summary>
        /// 外幣定的SheetName
        /// </summary>
        /// <returns></returns>
        public string GetTDSheetName()
        {
            return Sheets[3];
        }

        /// <summary>
        /// 外幣活的利差SheetName
        /// </summary>
        /// <returns></returns>
        public string GetDDRateDiffSheetName()
        {
            return Sheets[1];
        }

        /// <summary>
        /// 外幣定的利差SheetName
        /// </summary>
        /// <returns></returns>
        public string GetTDRateDiffSheetName()
        {
            return Sheets[0];
        }


        /// <summary>
        /// 外幣活的佔比
        /// </summary>
        /// <returns></returns>
        public string GetDDOccupyName()
        {
            return Sheets[4];
        }


        /// <summary>
        /// 外幣定的佔比
        /// </summary>
        /// <returns></returns>
        public string GetTDOccupyName()
        {
            return Sheets[5];
        }

        public string GetDDFTPRateName()
        {
            return Sheets[6];
        }

        public string GetTDFTPRateName()
        {
            return Sheets[7];
        }

    }
}
